//
//  HPHttpBaseRequest.m
//  HappyPenguin
//
//  Created by zhuangyihang on 1/25/16.
//  Copyright © 2016 zhuangyihang. All rights reserved.
//

#import "HPHttpBaseRequest.h"
#import "NSDictionary+Common.h"

@implementation HPHttpBaseRequest

- (HttpBaseResponse *)getResponse:(id)data{
    return [[HttpBaseResponse alloc] init];
}

#pragma mark -
- (NSDictionary *)getParameter{
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:[self getAuthenticationToken]];
    if ([self getAppType].length>0) {
        [dic setObject:[self getAppType] forKey:@"type"];
    }
    
    NSDictionary *baseParam = [[self prepareForParameter] merge:[self infoParameter]];
    return [dic merge:baseParam];
}

- (NSDictionary *)infoParameter{
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    return @{@"version":version,@"device":@"2"};
}

- (NSDictionary *)getAuthenticationToken{
    NSString *bsid = @"888";
    NSString *token = @"qwerasdfzxc";
    return @{@"bsid":bsid,@"tokenid":token};
}

- (NSString *)getPathComponent{
    return @"";
}


#pragma mark -
- (NSDictionary *)prepareForParameter{
    return @{};
}

- (NSString *)getAppType{
    return @"";
}
@end
